const { request } = require('../axios/axios-main')
const env = 'my-book-assist-7gc4zqa8552557ed'

// 修改评论，至少需要将用户数据内的评论内容修改，有时间再修改评论数据库的内容
exports.editComment = (_data) => {
  return request({
    method: 'POST',
    url: `/tcb/invokecloudfunction?access_token=${_data.access_token}&env=${env}&name=editComment`,
    data: _data
  })
}

// 删除评论
exports.deleteComment = (data) => {
  return request({
    method: 'POST',
    url: `/tcb/invokecloudfunction?access_token=${data.access_token}&env=${env}&name=deleteComment`,
    data
  })
}

// 修改书籍评论
exports.editBookComment = (data) => {
  return request({
    method: 'POST',
    url: `/tcb/invokecloudfunction?access_token=${data.access_token}&env=${env}&name=editBookComment`,
    data
  })
}

// 删除书籍评论
exports.deleteBookComment = (data) => {
  return request({
    method: 'POST',
    url: `/tcb/invokecloudfunction?access_token=${data.access_token}&env=${env}&name=deleteBookComment`,
    data
  })
}
